﻿using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _07_Serilog_集中化_结构化日志
{
    class test1
    {
        private readonly ILogger<test1> logger;
        public test1(ILogger<test1> logger)
        {
            this.logger = logger;
        }

        public void wLog()
        {
            logger.LogDebug("开始执行FTP同步");
            logger.LogDebug("连接FTP成功");
            logger.LogWarning("查找FTP失败，重试第一次");
            //......
            logger.LogWarning("查找FTP失败，重试第二次");
            logger.LogError("查找FTP最终失败");

            User user = new User { Name="aggie",Email="qq.com"};
            logger.LogDebug("注册了一个用户{@person}",user); //{@person} 必须写
        }
    }
}
